package com.smt.common.utils;

/**
 * @author zhangyi
 * @date 2018/10/19 16:31
 */
public class RandomUtil {

    /**
     * 生成随机数字
     *
     * @param length
     */
    public static String randomNumber(int length){
        String str = "0123456789";
        StringBuffer stringBuffer = new StringBuffer("");
            for (int i = 0; i < length; i++) {
                int floor = (int) Math.floor(Math.random() * str.length());
                stringBuffer.append(floor);
            }
        return stringBuffer.toString();
    }
}
